import 'package:dirver/routes.dart';
import 'package:flutter/material.dart';

class PageContent extends StatelessWidget {
  final String name;

  const PageContent({Key? key, required this.name}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final theme = Theme.of(context);
    final primaryColor = theme.primaryColor;
    
    return  Scaffold(
      appBar: AppBar(
        title: Text('当前页面 $name',style: TextStyle(color: Colors.white)),
        backgroundColor: primaryColor,
        // leading: IconButton(onPressed: () {
        //   Navigator.pop(context);
        // }, 
        // icon: Icon(Icons.arrow_back_ios),
        //   color: Colors.white,
      ),
      body: Center(
        child: ListView(
          children: [
            FloatingActionButton(child: Text(Routes.home),onPressed: () {
              Navigator.pushNamed(context, Routes.home);
            },),
            ElevatedButton(child: Text(Routes.login),onPressed: () {
              Navigator.pushNamed(context, Routes.login);
            },),
            ElevatedButton(child: Text('404'),onPressed: () {
              Navigator.pushNamed(context, '/404');
            },),
            ElevatedButton(child: Text('详情'),onPressed: () {
              Navigator.pushNamed(context, '/detail/1');
            },),
          ],
        ),
      ),
    );
  }
}